<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/6/11 0011
 * Time: 0:25
 */

namespace app\common\model;


use think\Db;
use think\Model;

class Recyclebin extends Model
{
    public function del_data($where,$data){
       $datas['tablename']= Db::name($data['tablename'])->where($where)->find();
       if(!empty($data['tablename_data'])){
           $datas['tablename_data']= Db::name($data['tablename_data'])->where($where)->find();
       }

    return $datas;

    }

    public function add_data($data){
        $datas['admin_id']=json_encode($data['admin_id']);
        $datas['tablename']=$data['tablename'];
        $datas['tablename_data']=$data['tablename_data'];
        $datas['name']=$data['name'];
        $datas['delid']=$data['delid'];
        $datas['content']=json_encode($data['content']);
        $datas['inputtime']=time();
        $datas['updatetime']=time();
        $datas['reductiontime']=time();
        $datas['removetime']=time();
        $datas['status']=1;
        $datas['ip']=json_encode($data['ip']);
       return $this->insert($datas);
    }
}